#include "game_status_indicator.h"

#include <qpainter.h> 

GameStatusIndicator::GameStatusIndicator (QWidget * parent, const char * name, WFlags f) 
: QFrame (parent, name, f)
{
}

GameStatusIndicator::~GameStatusIndicator () {}

void GameStatusIndicator::setPlayerInfo (QString name, QColor col) {
	playerName = name; 
	color = col;
}

void GameStatusIndicator::paintEvent ( QPaintEvent * event ) {
	QPainter e (this);
	e.fillRect (rect().left() + 150, rect().top(), rect ().right(), rect ().bottom (), QBrush(color));
	e.translate (0, rect().bottom());
	e.drawText (0, -2, "Now playing: " + playerName);
}

QSizePolicy GameStatusIndicator::sizePolicy() const
{
    return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
}

QSize GameStatusIndicator::sizeHint () const
{
	return QSize (200, 15);
}